Add support for partitioned (CHIPS) cookies#572
Open
alex-gutev wants to merge 3 commits intovimalloc:mainfrom
Open
Add support for partitioned (CHIPS) cookies#572alex-gutev wants to merge 3 commits intovimalloc:mainfrom
alex-gutev wants to merge 3 commits intovimalloc:mainfrom
Conversation
This controls whether the JWT access and CSRF protect token cookies are marked as partitioned.
vimalloc
approved these changes
Apr 16, 2026
Owner
|
It looks like there are a couple lint errors, and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces support for the Partitioned attribute in cookies generated by
flask-jwt-extended.As browsers move toward deprecating third-party cookies, the CHIPS standard allows cookies to be set in "partitioned" storage using a new jar per top-level site. This is specifically required when the authentication server (API) resides on a different domain than the client application. Partitioned cookies prevent cross-site tracking while allowing functional cross-site needs like authentication.
The Problem
Without the Partitioned attribute, browsers are beginning to surface the following warning (and will eventually block the cookie entirely), when the authentication server resides on a different domain than the client application:
Changes
Added
JWT_COOKIE_PARTITIONEDconfiguration variable (defaults toFalse).Updated
set_access_cookiesandset_refresh_cookiesto include the partitioned parameter when callingset_cookie.